package com.chenxbook.modules.examples.custom;

import org.jbpm.api.activity.ActivityBehaviour;
import org.jbpm.api.activity.ActivityExecution;

import java.util.Set;

/**
 * 自定义活动"update serialized variables"
 */
public class UpdateSerializedVariables implements ActivityBehaviour {


    @Override
    public void execute(ActivityExecution execution) throws Exception {
        Set<String> messages = (Set<String>) execution.getVariable("messages");
        messages.clear();
        messages.add("i");
        messages.add("was");
        messages.add("updated");
    }
}
